import threading
import sys
import time

a = 10

class print_out(threading.Thread):

    def __init__ (self, m1, m2):

        #constructor basic class
        threading.Thread.__init__(self)
        self.m1 = m1
        self.m2 = m2
        self.a = 33

    def run(self):
        
        for i in range(1000000):
            global a
            a  = i 
            
        print self.getName()

threads = []
for num in range(0, 5):
    thread = print_out('a', 'b')
    thread.start()
    threads.append(thread)

#Wait for all threads to complete!!!
for thread in threads:
    thread.join()
    
print "Exiting Main Thread"
print a
    
